// Copyright (c) 2020-present,  INSPUR Co, Ltd.  All rights reserved.
// This source code is licensed under Apache 2.0 License.
#include "pure_mem/memoryblock/memory_arena/abstract_memory_arena.h"
namespace rocksdb{
//liliupeng 范围删除
typedef void* KeyHandle;
typedef InlineUserKeyIndex<const MemTableRep::KeyComparator &> ArtTree;
class RangeDelMemArena : public IMemoryArena {
public:
    class RangeDelKeyComparator : public MemTableRep::KeyComparator {
    public:
        const InternalKeyComparator comparator;
        explicit RangeDelKeyComparator(const InternalKeyComparator& c) : comparator(c) { }
        int operator()(const char* prefix_len_key1,
                       const char* prefix_len_key2) const override;
        int operator()(const char* prefix_len_key,
                       const DecodedType& key) const override;
    };

public:
    explicit RangeDelMemArena(const InternalKeyComparator& mkeyCmp, const ImmutableCFOptions& ioptions);
    ~RangeDelMemArena() override;

    bool Insert(const Slice& key, const Slice& value) override ;

    ArtTree::Iterator *Seek(const Slice& key) override ;

//    std::shared_ptr<InternalIterator> NewMemIter(bool use_range_del_table) ;

    size_t GetTotalMemVolume() const override {
      return 0;
    }
//
//    uint64_t GetOldestKeyTime() const override {}

private:
    RangeDelKeyComparator mkey_cmp_;
    const ImmutableCFOptions& moptions_;
    ArtTree range_del_list_{mkey_cmp_, ART_ROWEX};

};
}   //namespace rocksdb